import re 

class io_loc_proc:
    def __init__(self):
        self.io_descrip=[]
        self.io_loc_map={}

    def str2list(self, str1):
        
        length=len(str1)
        strlist=[]
        for i in range(0,length):
            print(str1[i])

    # for nets like dimm_a0 
    def strsub(self, str1, str2):
        len1=len(str1)
        len2=len(str2)
        subgood=False
        assert(len1>=len2)
        i=0
        while(i < len2):
            if str1[i]==str2[i]:
                i=i+1
            else:
                break
        print(str1[:i])
        print(str2[:i])
        print(str1[i:])
        if i==len2:
            subgood=True
        isnumber=self.charisnumber(str1[i:])
        print(i, len2, isnumber)
        if isnumber==True and subgood==True:
            print('正常的完全减法')

    def charisnumber(self, str1):
        return str1.isdigit()









ii=io_loc_proc()
# ii.str2list('iwasgood')
ii.strsub('dimm_abb02','dimm_ab')
